home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 19 / Amiga Plus Leser CD 19.iso / Tools / MorphOS / cvs-1.11.2 / source / amiga / ssh / blowfish.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-11-18  |  1.0 KB  |  39 lines

  1. /*
  2.  * Blowfish cipher structures and functions
  3.  *
  4.  * $Id$
  5.  *
  6.  * :ts=4
  7.  */
  8.  
  9. #ifndef _BLOWFISH_H
  10. #define _BLOWFISH_H
  11.  
  12. /****************************************************************************/
  13.  
  14. #ifdef _SSH
  15. #define blowfish_encrypt_cbc    SSH_blowfish_encrypt_cbc
  16. #define blowfish_decrypt_cbc    SSH_blowfish_decrypt_cbc
  17. #define blowfish_setkey            SSH_blowfish_setkey
  18. #endif /* _SSH */
  19.  
  20. /****************************************************************************/
  21.  
  22. typedef struct
  23. {
  24.     unsigned long S0[256], S1[256], S2[256], S3[256], P[18];
  25.     unsigned long biv0, biv1; /* for CBC mode */
  26. } BlowfishContext;
  27.  
  28. #define SSH_SESSION_KEY_LENGTH    32
  29.  
  30. /****************************************************************************/
  31.  
  32. void blowfish_encrypt_cbc(unsigned char *blk, int len, BlowfishContext *ctx);
  33. void blowfish_decrypt_cbc(unsigned char *blk, int len, BlowfishContext *ctx);
  34. void blowfish_setkey(BlowfishContext *ctx, const unsigned char *key, short keybytes);
  35.  
  36. /****************************************************************************/
  37.  
  38. #endif /* _BLOWFISH_H */
  39.